package com.websem.client.views;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

/**
 * @author haifa
 * 
 */
public class TitleView extends Composite {
	private static TitleViewUiBinder uiBinder = GWT
			.create(TitleViewUiBinder.class);

	interface TitleViewUiBinder extends
			UiBinder<Widget, TitleView> {
	}
	private HorizontalPanel zoneRecherche;
	private TextBox normalText;
	@UiField
	Button normalPushButton ;

	public TitleView() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	public Widget onInitialize() {
		normalText = new TextBox();
		zoneRecherche = new HorizontalPanel();
		zoneRecherche.getElement().setAttribute("id", "horizontalPanel");
		zoneRecherche.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
		zoneRecherche
				.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		zoneRecherche.getElement().setAttribute("vertical-align", "middle");

		normalText.getElement().setAttribute("placeholder",
				"Acteurs, Titre de Films ...");
		normalText.setStyleName("mercureTextBox");
		normalText.setHeight("24px");
		
		normalPushButton.setStyleName("mercureSearchButton");
		zoneRecherche.add(normalText);

		zoneRecherche.add(normalPushButton);
		return zoneRecherche;

	}

	/**
	 * @return the normalText
	 */
	public TextBox getNormalText() {
		return normalText;
	}

	/**
	 * @param normalText
	 *            the normalText to set
	 */
	public void setNormalText(TextBox normalText) {
		this.normalText = normalText;
	}

	/**
	 * @return the normalPushButton
	 */
	public Button getNormalPushButton() {
		return normalPushButton;
	}

	/**
	 * @param normalPushButton
	 *            the normalPushButton to set
	 */
	public void setNormalPushButton(Button normalPushButton) {
		this.normalPushButton = normalPushButton;
	}

}
